<template>
  <div>
    <h1>mytest</h1>
    <p>{{ age1 }}</p>
    <p>{{ a }}</p>
    <button @click="updatestate(6)">mapmutation修改</button>
    <button @click="updateAgeAfter(3)">actions修改age</button>
  </div>
</template>

<script>
import { mapState, mapMutations, mapGetters, mapActions } from 'vuex'
export default {
  //对象形式就是为了改名 防止重复

  computed: {
    // ...mapState(['age']),
    ...mapState({ age1: 'age' }),
    // ...mapGetters({a:'a'})
    ...mapGetters(['a'])
  },
  methods: {
    ...mapMutations({ updatestate: 'updatestate' }),
    // ...mapMutations(['updatestate']),
    ...mapActions({ updateAgeAfter: 'updateAgeAfter' })
    // ...mapActions(['updateAgeAfter'])
  }
}
</script>

<style></style>
